//
//  HRHearRootRightView.m
//  Hear
//
//  Created by mac on 2018/4/19.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "HRHearRecommendRightView.h"

@implementation HRHearRecommendRightView

-(id)initWithFrame:(CGRect)frame
{
    if (self == [super initWithFrame:frame])
    {
        _topicOwnerBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _topicOwnerBtn.layer.cornerRadius = 34 * scaleWidth / 2;
        _topicOwnerBtn.layer.masksToBounds = YES;
        [self addSubview:_topicOwnerBtn];
        [_topicOwnerBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self);
            make.right.mas_equalTo(self);
            make.height.mas_equalTo(34 * scaleWidth);
            make.width.mas_equalTo(34 * scaleWidth);
        }];
        
        _likeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_likeBtn setBackgroundImage:[UIImage imageNamed:@"未点赞"] forState:UIControlStateNormal];
        [_likeBtn setBackgroundImage:[UIImage imageNamed:@"已点赞"] forState:UIControlStateSelected];
        [_likeBtn addTarget:self action:@selector(like) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_likeBtn];
        [_likeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.mas_equalTo(_topicOwnerBtn.mas_centerX);
            make.width.mas_equalTo(28);
            make.top.mas_equalTo(_topicOwnerBtn.mas_bottom).offset(29 * scaleHeight);
            make.height.mas_equalTo(25 * scaleHeight);
        }];
        
        _likeNumLabel = [[UILabel alloc] init];
        _likeNumLabel.font = [UIFont systemFontOfSize:13];
        _likeNumLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_likeNumLabel];
        [_likeNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(_likeBtn.mas_bottom).offset(13);
            make.left.mas_equalTo(_likeBtn.mas_left);
            make.right.mas_equalTo(_likeBtn.mas_right);
        }];
        _messageBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_messageBtn setBackgroundImage:[UIImage imageNamed:@"留声机评论"] forState:UIControlStateNormal];
        [_messageBtn addTarget:self action:@selector(like) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_messageBtn];
        [_messageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(_likeBtn.mas_right);
            make.left.mas_equalTo(_likeBtn.mas_left);
            make.top.mas_equalTo(_likeNumLabel.mas_bottom).offset(29 * scaleHeight);
            make.height.mas_equalTo(25 * scaleHeight);
        }];
        
        _messageNumLabel = [[UILabel alloc] init];
        _messageNumLabel.font = [UIFont systemFontOfSize:13];
        _messageNumLabel.textAlignment = UITextAlignmentCenter;
        [self addSubview:_messageNumLabel];
        [_messageNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(_messageBtn.mas_bottom).offset(13);
            make.left.mas_equalTo(_messageBtn.mas_left);
            make.right.mas_equalTo(_messageBtn.mas_right);
        }];
        _forwardBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_forwardBtn setBackgroundImage:[UIImage imageNamed:@"转发主页"] forState:UIControlStateNormal];
        [_forwardBtn addTarget:self action:@selector(forward) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_forwardBtn];
        [_forwardBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(_messageBtn.mas_right);
            make.left.mas_equalTo(_messageBtn.mas_left);
            make.top.mas_equalTo(_messageNumLabel.mas_bottom).offset(29 * scaleHeight);
            make.height.mas_equalTo(25 * scaleHeight);
        }];
        
        _forwardNumLabel = [[UILabel alloc] init];
        _forwardNumLabel.font = [UIFont systemFontOfSize:13];
        _forwardNumLabel.textAlignment = UITextAlignmentCenter;
        [self addSubview:_forwardNumLabel];
        [_forwardNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(_forwardBtn.mas_bottom).offset(13);
            make.left.mas_equalTo(_likeBtn.mas_left);
            make.right.mas_equalTo(_likeBtn.mas_right);
        }];
    }
    return self;
}


@end
